//处理路由相关
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

const Home = () => import('../views/Home');
const Category = () => import('../views/Category');
const Cart = () => import('../views/Cart');
const Profile = () => import('../views/Profile');
const Detail = () => import('../views/Goods/detail');
const List = () => import('../views/Goods/list');
const Search = () => import('../views/Goods/search');
const Login = () => import('../views/Login/login');
const PwdLogin = () => import('../views/Login/pwdLogin');
const Register = () => import('../views/Login/register');
const ResetPass = () => import('../views/Login/resetPass');
export default new VueRouter({
  routes: [{
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/category',
      name: 'Category',
      component: Category
    },
    {
      path: '/cart',
      name: 'Cart',
      component: Cart
    },
    {
      path: '/profile',
      name: 'Profile',
      component: Profile
    },
    {
      path: '/goods/detail/:id',
      name: 'Detail',
      component: Detail
    },
    {
      path: '/goods/list',
      name: 'List',
      component: List
    },
    {
      path: '/goods/search',
      name: 'Search',
      component: Search
    },
    {
      path:'/login/pwdLogin',
      name:'PwdLogin',
      component:PwdLogin
    },
    {
      path:'/login/login',
      name:'Login',
      component:Login
    },
    {
      path:'/login/register',
      name:'Register',
      component:Register
    },
    {
      path:'/login/resetPass',
      name:'ResetPass',
      component:ResetPass
    },

  ],
  mode: 'history'
})